|
|
|
|
|
|
|
· Disable data entry in the fields (RSEnable False) |
|
|
|
|
|
|
|
|
· Reset the command button labels and enable all the buttons |
|
|
|
|
|
|
|
|
The save operation is the most complicated process. The locate, delete, and browse operations are much easier to accomplish and require less coding. The key to remember here is that you are providing all the user-level processes of the data control in this set of Visual Basic code. Although it seems to be a large code piece, you can use it in all your Visual Basic projects once you have it on file. |
|
|
|
|
|
|
|
|
Compile the OLE Server library so you can use it later. Select File | Make prjRecObject.DLL from the main Visual Basic menu and compile the DLL. In future projects, all you need to do is add a reference to this new object, and you'll be ready to create complete data entry forms with very little coding. |
|
|
|
|
|
|
|
|
Creating a Data Entry Form with the Library Routines |
|
|
|
|
|
|
|
|
Now that you have a solid library set for creating data entry forms, you can build a new form for the CompanyMaster project. To do this, you add a new form to the CompanyMaster project. This form is a simple validation list that you can use to validate input for other portions of the project. |
|
|
|
|
|
|
|
|
If you haven't done it yet, start Visual Basic and load the MASTER.VBP project. This project is a copy of the project you built last week. The first thing you must do is add a reference to the prjRecObject.DLL in the CompanyMaster project. Select Project | References from the main menu and then locate and select prjRecObject.DLL (see Figure 10.4). |
|
|
|
|
|
|
|
|
Figure 10.4.
Locating and selecting the prjRecObject OLE Server DLL. |
|
|
|
|
|